<?php
namespace Models;
class UserModel extends CommonModel {

    public function getUserByUsername($username) {
        $sql = 'select * from users where username = "' . $username . '" limit 1';
        $result = $this->db->query($sql);
        return $result->fetch();
    }

    public function add($username, $password) {
        $sql = 'insert into users(username, password) values
                ("' . $username . '", "' . $password . '")';
        return $this->db->exec($sql);
    }
}